/**
 * @file
 * @author dousha 
 * @date 2021/4/22.
 */

#ifndef SOLVER_H
#define SOLVER_H

#include <stdint.h>
#include "mpu.h"

typedef struct {
	uint16_t yaw; // 0.1deg
	uint16_t pitch; // 0.1deg
} Direction;

typedef struct {
	int32_t latitude;
	int32_t longitude;
	int32_t elevation;
	float pitch;
	float yaw;
	float roll;
} Position;

extern void solver_init();

extern void solver_tick();

extern void solver_update_remote();

extern const Position *solver_get();

extern const Direction *solver_solve();

extern void solver_set_target_pitch(uint16_t);

extern void solver_set_target_yaw(uint16_t);

extern void solver_set_self_yaw(uint16_t yaw);

extern int16_t solver_get_self_pitch();

extern int16_t solver_get_self_yaw();

extern void solver_set_remote_lat(int32_t);

extern void solver_set_remote_lng(int32_t);

extern void solver_set_remote_alt(int32_t);

extern int32_t solver_get_remote_lat();

extern int32_t solver_get_remote_lng();

extern int16_t solver_get_remote_alt();

extern void solver_set_current_as_remote();

extern const MpuData *solver_get_corrected_mpu_data();

extern void solver_mark_current_yaw_as_zero();

#endif
